05. Running a Python Script
If you are on a Windows machine, you can follow along using git . If you are on a Mac or Linux machine, the terminal should be available with a quick search. You should then be able to follow along as shown in the video below.
Running A Python Script
Run a Python Script!
-
Download the zip file
first_script
attached at the bottom of this page (click it to unzip the file, then move it to an appropriate directory on your computer). This might be a good time to set up a new directory for your learning if you don't have one already. -
Open your terminal and use
cd
to navigate to the directory containing that downloaded file. -
Now that you’re in the directory with the file, you can run it by typing
python first_script.py
and pressing enter. Note: You may have to enterpython3
instead ofpython
to execute Python 3 if you have both versions installed on your computer.
You’ll know you’ve run the script successfully if you see this message printed to your terminal:
Congratulations on running this script!!